package com.wx.tgp.shopping.text;

import com.wx.tgp.shopping.entity.Category;
import com.wx.tgp.shopping.service.CategoryService;
import com.wx.tgp.shopping.service.impl.CategoryServiceImpl;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import javax.annotation.Resource;
import java.util.Date;

/**
 * 用来测试Spring的IOC
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:beans.xml")
public class SSHtest {

    @Resource
    private Date date;

    @Resource
    private CategoryService categoryService;

    @Test
    public void springIOC(){
        System.out.println(date);
    }

    @Test
    public void hibernateTest(){
        Category category = new Category();
        category.setId(1);
        category.setType("男士休闲");
        category.setHot(true);
        categoryService.update(category);
    }

}
